package com.lizhi.yun.system.rsz.handler;/**
 * @program: hbsf_yun
 * @name RszPatientHandler
 * @description:
 * @author: lizhi
 * @create: 2021-11-03 14:24
 */

import com.lizhi.client.RestClientService;
import com.lizhi.common.yun.entity.ListResponseResult;
import com.lizhi.utils.json.SamJsonUtil;
import com.lizhi.yun.base.BaseHandler;
import com.lizhi.yun.system.rsz.enums.RszServiceEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 *@program: hbsf_yun
 *@name RszPatientHandler
 *@description:
 *@author: lizhi
 *@create: 2021-11-03 14:24
 */
@Slf4j
@Service
public class RszPatientHandler extends BaseHandler {

    @Resource
    private RestClientService restClientService;

    public ListResponseResult doMain(Map<String, Object> map, HttpServletRequest request) {
        String result = restClientService.postStringToService(RszServiceEnum.HBSF_RSZ_PATIENT_INFO.getEnName(), RszServiceEnum.HBSF_RSZ_PATIENT_INFO.getEnValue(), SamJsonUtil.toJson(map));
        return SamJsonUtil.toObject(result, ListResponseResult.class);
    }
}
